package j_graphics;
// 패널에 사각형 그리기

import java.awt.*;
import java.awt.event.*;

class MyPanel extends Frame
{
	Panel panel =new Panel();
	public MyPanel()
	{
		setSize(300,300);
		setTitle("Graphics");
		add(panel);
	}
	
	public void paint(Graphics g)
	{
		draw();
	}
	
	public void draw()
	{
		Graphics g = panel.getGraphics();
		g.drawRect(50,50,100,100);
		g.drawLine(50,50,150,150);
		g.drawLine(150,50,50,150);

		
	}
	public static void main(String args[])
	{
		MyPanel f=new MyPanel();
		f.setVisible(true);
		f.repaint();
	}
}